﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataCore.DomainObjects
{
    [Serializable]
    public class Value: DomainObject<long>
    {
        private Atribute _atribute;
        private Object _binaryValue;
        
        public Value()
        {}
        public Value(Atribute atribute)
        {
            _atribute = atribute;
        }

        public Atribute CurrentAttribute { 
            get{ return _atribute;}
            set { _atribute = value;}
        }

        public Object BinaryValue
        {
            get { return _binaryValue; }
            set { _binaryValue = value; }
        }
       
        public  String GetAsString()
        {
            return _binaryValue.ToString();
        }

        public override int GetHashCode()
        {
            int m = 23;
            return String.Concat(m * 17,
                _atribute != null ? _atribute.GetHashCode().ToString() : "0",
                _binaryValue != null ? _binaryValue.GetHashCode().ToString() : "0").GetHashCode();
        }

        public override void CopyFrom(DomainObject<long> T)
        {
            throw new NotImplementedException();
        }
    }
}
